{include file="public/head"}
    <body>
    <div class="x-body">
      <div  class="lotus-nav" >
            

          <div class="layui-input-inline">
              <input value="{php}echo isset($_GET['username'])?$_GET['username']:'';{/php}"  name="username"   class="layui-input lotus-input"  placeholder="请输入项目名搜索">
          </div>

            <button class="layui-btn layui-btn-sm search-query"><i class="layui-icon layui-icon-search"></i></button>
            
            <span class="x-right">共有数据:<i class="i_count" style="color: red;font-size: 22px">{}</i>条 <button onclick="javascript:location.reload()" class="layui-btn layui-btn-xs"><i class="icon iconfont ">&#xe6aa;</i></button></span>

       </div>

    
    </div>
</body>
{include file="public/foot"}
    <script>
        var layer = layui.layer
            ,form = layui.form;


        $(".search-query").click(function () {
            var username = $("input[name=username]").val();
            window.location.href = 'userlist.html?username='+username;
        });

       
      function delWork(obj,id){
        var count = $(".i_count")[0].innerText;
        layer.confirm('确认要删除吗？',function(index){
            //捉到所有被选中的，发异步进行删除
            $.post("{:url('admin/user/deleteWork')}", {id: id}, function(data, textStatus, xhr) {
          /*optional stuff to do after success */
              console.log(data);
              if(data.code==1){
                  layer.msg(data.msg,{icon:1,time:1000},function(){
                    $(obj).parents('tr').remove();
                    $(".i_count").html(count-1);
                  });
              }else{
                  layer.msg(data.msg,{icon:2,time:1000});
              }
            
            });
        });
      }
    </script>
